/******************************************************文本框*****************************************************/
_$.Button=function (target){
    var _this = this;
    _$.Button.superclass.constructor.call(_this,target);
};
_$.regClass("Button",_$.Button);

_$.extend(_$.Button,_$.Component, {
    _cls:_$._clsPre + "Button",
    _uiCls:_$._uiPreCls + "Button",
    _attrProps:function(){
        var _this = this;
        var properties = _$.Button.superclass._attrProps.call(_this);
        properties.addAll(["clazz","iconCls","buttonText","onclick"]);
        return properties;
    },
    _attrOpts:function(){
        var _this = this;
        var opts = _$.Button.superclass._attrOpts.call(_this);
        return $.extend(true,opts,{
            "clazz":"btn btn-default",
            "iconCls":""
        });
    },
    _create:function(){
        var _this = this;
        var clazz = _this.getOption("clazz");
        var iconCls = _this.getOption("iconCls");
        var buttonText = _this.getOption("buttonText");
        var source='<button type="button" class="'+clazz+'"><span class="glyphicon '+iconCls+'"></span>'+buttonText+'</button>';

        _this._replaceNode(source);
        _this.component = _this.el;
        _this.el.addClass(_this._uiCls);
        _this._setStyle();
        _this._init();
        _this._bindEvents();
    },
    _init:function(){
        var _this = this;

        _this._loadSuccess();
    },
    _bindEvents:function(){
        var _this = this;
        _$.Button.superclass._getEvents.call(_this, ["onclick"]);
        var event = {
            "name":_this.id
        };
        _this.component.bind("click",function(){
            event['source'] = _this.component;
            _this._fire("onclick",event);
        });
    }
});
